package org.nerve.android.util;

import java.io.Serializable;
import java.lang.reflect.Field;

public class JSON {

	public static <T extends Serializable> T parse(Class<T> clazz, String json){
		T bean = null;
		try {
			bean = clazz.newInstance();
			
			Field[] fields = bean.getClass().getDeclaredFields();
			for(Field f:fields){
				if(!f.isAccessible())
					f.setAccessible(true);
				
				f.set(bean, "sasa");
			}
			
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InstantiationException e) {
			e.printStackTrace();
		}
		
		return bean;
	}
}